/**
 * @Author：ming
 * @Date：2023/10/29 2:10 PM
 * @Filename：Hot500
 */

/**
 * @author ming
 */
public class Hot500 {
    public int subarraySum(int[] nums, int k) {
        int len= nums.length;
        int count = 0;

        for (int i = 0; i < len ; i++) {
            int sum = 0;
            for (int j = i; j < len; j++) {
                sum += nums[j];
                if(sum == k){
                    count ++;
                }

            }
        }

        return count;
    }
}
